﻿using battlenet.wow.rt.sdk.data.dto;
using battlenet.wow.rt.sdk.utility;
using BnFile = battlenet.wow.rt.domain.objects.BnFile;

namespace battlenet.wow.rt.sdk.objects.mapper
{
    internal class BnFileMapper : Remapper<BnFile>
    {
        public override void RegisterMappers()
        {
            Register(typeof(BnFileInfo), input => Map(input as BnFileInfo));
        }

        internal BnFile Map(BnFileInfo info)
        {
            if(info == null) return new BnFile();
            var file = new BnFile(info.Url, info.LastModified);
            return file;
        }
    }
}
